import axios from "axios";
const http=axios.create({
    // 设置请求根地址
    baseURL:'http://shop.bluej.cn/api',
    timeout:5000,
})

export const post=(url,data)=>{
    return new Promise((resolve,reject)=>{
        http.post(url,data,{
            headers:{
                "Content-Type":"application/json",
            }
        })
        .then(res=>{
            resolve(res)
        })
        .catch(err=>{
            reject(err)
        })
    })
}